using System;
using System.Collections.Generic;
using System.Text;
using CMS.BIZ;
using AAM.DAL;
using AAM.BIZ;
using AAM.SQL;

namespace CMS.BOP
{
    public class SqlBizContentProvider : SqlBizObjectProvider<BizContent>
    {
        public BizContent Read(int contentID, string culture)
        {
            return Read(new ObjectID(BizContent.ObjectType, new object[] { contentID, culture }));
        }
        public int GetMaxID()
        {
            Command command = Connection.CreateCommand("SELECT MAX(ContentID) FROM Contents");
            object obj = command.ExecuteScalar();
            return obj == null ? 0 : (int)obj;
        }
        public bool Delete(int contentId, string cultureCode)
        {
            return Delete(new ObjectID(BizContent.ObjectType, new object[] { contentId, cultureCode }));
        }
        public BizContent Find(int contentID, string cultureCode)
        {
            return Find(new ObjectID(BizContent.ObjectType, new object[] { contentID, cultureCode }));
        }
    }
}
